<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<link rel="icon" href="${pageContext.request.contextPath}/favicon.ico"  type="image/x-icon"/>
	<link href="${pageContext.request.contextPath}/style/news.css" rel="stylesheet">
	<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
	<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
	<script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
	<script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<div class="data_list backMain">
	<div class="dataHeader navi">
		 当前位置：&nbsp;&nbsp;
		主页&nbsp;&nbsp;&gt;&nbsp;&nbsp;
		新闻类别管理&nbsp;&nbsp;&gt;&nbsp;&nbsp;
		新闻类别维护&nbsp;&nbsp;
	</div>
	<div class="data_content">
		<table class="table table-hover table-bordered">
			<tr>
				<th>序号</th>
				<th>新闻类别名称</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${list}" var="type" varStatus="in">
				<tr>
					<td>${in.count}</td>
					<td>${type.typeName}</td>
					<td>
						<button class="btn btn-mini btn-info" onclick="update(${type.id})" type="button">修改</button>&nbsp;&nbsp;
						<button class="btn btn-mini btn-danger" onclick="del(${type.id})" type="button">删除</button>
						<script>
							function update(id){
								location.href="${pageContext.request.contextPath}/type?method=updateUI&id="+id;
							}
							function del(id){
								if(confirm("你确定删除吗？"))
									location.href="${pageContext.request.contextPath}/type?method=del&id="+id;
							}
						</script>

					</td>
				</tr>
			</c:forEach>
		</table>
	</div>
</div>
</body>
</html>